<%@ page language="java" contentType="text/html; charset=ISO-8859-1"  pageEncoding="ISO-8859-1"%>
<%@page import="dto.ArticuloDTO"%>
<%@ page import= "java.util.Iterator"%>
<%@ page import= "java.util.List"%>

<!DOCTYPE html>
<html lang="en">

<head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title>Lista de Articulos</title>
        <meta name="description" content="">
        <meta name="HandheldFriendly" content="True">
        <meta name="MobileOptimized" content="320">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
        <link rel="stylesheet" type="text/css" href="css/ink.css">
        <link rel="stylesheet" type="text/css" href="css/quick-start.css">
        
        <!--[if IE 7 ]>
            <link rel="stylesheet" href="../TPOAICliente/css/ink-ie7.css" type="text/css" media="screen" title="no title" charset="utf-8">
        <![endif]-->
        
        <script type="text/javascript" src="js/holder.js"></script>
        <script type="text/javascript" src="js/ink.min.js"></script>
        <script type="text/javascript" src="js/ink-ui.min.js"></script>
        <script type="text/javascript" src="js/autoload.js"></script>
        <script type="text/javascript" src="js/html5shiv.js"></script>
		<script type="text/javascript" src="/js/jquery-1.8.2.js"></script>
		
        <style>
            .screen-size-helper {
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
                width: 100%;
                line-height: 1.6em;
                font-size: 1em;
                padding: 0.5333333333333333em 0.8em;
                background: rgba(0, 0, 0, 0.7);
                z-index: 100;
            }
            .screen-size-helper .title,
            .screen-size-helper ul {
                color: white;
                text-shadow: 0 1px 0 #000000;
            }
            .screen-size-helper .title {
                font-size: inherit;
                line-height: inherit;
                float: left;
                text-transform: uppercase;
                font-weight: 500;
            }
            .screen-size-helper ul {
                float: right;
                margin: 0;
                padding: 0;
                line-height: inherit !important;
            }
            .screen-size-helper ul li {
                padding: 0;
                margin: 0;
                text-transform: uppercase;
                font-weight: bold;
                font-size: inherit !important;
            }
            .screen-size-helper ul li.small {
                color: #80c431;
            }
            .screen-size-helper ul li.medium {
                color: #80c431;
            }
            .screen-size-helper ul li.large {
                color: #80c431;
            }
            .screen-size-helper ul li.extra-large {
                color: #80c431;
            }
        </style>

    </head>
<body>
<form  id="articulosForm"  >
	
		<input type="text" name="word"   placeHolder="Palabra">
		<select name="filter">
			<option selected>deposito</option>
			<option>codigo</option>
			<option>descripcion</option>
		</select>
		<input type="submit" name="submit" value="Ingresar">
</form>
<br>

        <div class="box">
                    <table class="ink-table">
                        <thead>
					            <tr>
									<th colspan="4" style="background-color:#1C70C2; color:white;"><b>Lista de Articulos</b></th>
								</tr>
								<tr>
									<th><b>Id</b></th>
									<th><b>Codigo</b></th>
									<th><b>Descripcion</b></th>
									<th><b>Deposito</b></th>
									
									
								</tr>
                        </thead>
                                                  
                        <tbody>
                           <%
								ArticuloDTO aux;
								Integer id; 	
								List<ArticuloDTO> articulos = (List<ArticuloDTO>)request.getAttribute("articulos");
								for(Iterator<ArticuloDTO> i = articulos.iterator(); i.hasNext();)
								{
									aux = i.next();
									id = aux.getId();
							%>
								<tr>
								
									<td><%=aux.getId()%></td>	
							 		<td><%=aux.getCodigo()%></td>
							 		<td><%=aux.getDescripcion()%></td>
									<td><%=aux.getDeposito()%></td>
									
								
									
									
								</tr>
							<% } %>
                        </tbody>
                    </table>
        </div>
<script>


$("#articulosForm").submit(function() {
    var url = "ControladorArticulo?action=displaylist";
    $.ajax({
           type: "POST",
           url: url,
           data: $("#articulosForm").serialize(), 
           success: function(data)
           {
               $(".htmlContent").html(data).hide().fadeIn('slow');
           }
         });

    return false; 
});
</script>
</body>



</html>